package com.eliaukjq.jqrpc.registry;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author : 佩萁
 * Description :本地注册中心
 * @Create : 2024/2/23 - 11:34
 */
public class LocalRegistry {
    //注册信息存储
    private static final Map<String, Class<?>> map = new ConcurrentHashMap<>();

    //注册服务
    public static void register(String serviceName, Class<?> implClass) {
        map.put(serviceName, implClass);
    }

    //获取服务
    public static Class<?> get(String serviceName) {
        return map.get(serviceName);
    }

    //删除服务
    public static void remove(String serviceName) {
        map.remove(serviceName);
    }
}